cmake_minimum_required(VERSION 3.14)
set(CMAKE_VERBOSE_MAKEFILE ON)
enable_testing()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
project(ringbuffer LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_library(ringbuffer SHARED
  ringbuffer_global.h
  ringbuffer_global.cpp
  ringbuffer.cpp
  ringbuffer.h
)

target_compile_definitions(ringbuffer PRIVATE RINGBUFFER_LIBRARY)

add_executable(my_tests test.cpp)

target_link_libraries(my_tests ringbuffer)

add_test(NAME MyTest COMMAND my_tests)
